//
// Created by EmFi on 2023/5/19.
//

#ifndef DBMS_TIMEUTIL_H
#define DBMS_TIMEUTIL_H

struct TimeInfo {
    int year;
    int month;
    int day;
    int hour;
    int minute;
    int second;
};

class TimeUtil {
public:
    static TimeInfo now() {
        time_t now = time(nullptr);
        tm* tm_t = localtime(&now);
        TimeInfo info {tm_t->tm_year + 1900, tm_t->tm_mon + 1, tm_t->tm_mday, tm_t->tm_hour, tm_t->tm_min, tm_t->tm_sec };
        return info;
    }
};

#endif //DBMS_TIMEUTIL_H
